package model.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import model.domain.UserInfoBean;
import model.util.DBUtil;

public class UserInfoDAO {
	private static SqlMapClient sqlMapper = DBUtil.getParser();

	public static List<UserInfoBean> selectAllUserId() {
		List<UserInfoBean> list = null;
		try {
			list = sqlMapper.queryForList("userInfo.selecAllUserId");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}

	public static void insertUserInfo(UserInfoBean bean) {
		try {
			sqlMapper.update("userInfo.insertUserInfo", bean);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	// 회원가입버튼 눌렀을때(완료) 실행되는 DAO(개인 테이블 생성 DAO)
	public static void createTable(String userId) {
		try {
			sqlMapper.update("userInfo.createTable", userId);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
